<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        <hr>
        <father></father>
    </div>
    <script type='text/javascript'>
    /* 这是son组件*/
        var com2 = {
            template: `
                <span class='son'>我会一个son组件</span>
            `
        }
        /*  这是father组件 */
        var com1 = {
            template: `
                <p class='father'>
                我会一个father组件=======<son></son>  
                </p>
            `,
            components: {
                son: com2  //这里是将son组件挂载到father组件上
            }
        }

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            },
            components: {
                father: com1  //挂载  这里是将father挂载到app组件上
            }
        });
    </script>
</body>

</html>